package com.probiz.estore.common.model.content.base;

import java.io.Serializable;

import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;

import com.probiz.estore.core.model.BaseObject;

/**
 * NewsletterGroup Base Java Bean, base class for the model, mapped directly to database table
 * 
 * Avoid changing this file if not necessary, will be overwritten. 
 *
 * organize newsletters and can be subscribed by customer
 */
public class NewsletterGroupTbl extends BaseObject implements Serializable {

    protected Integer newsletterGroupId;
	protected String name;
	protected String description;
	protected String templatePath;
	protected Short status;
	protected Short isVisibleToFront;
	protected Integer sortOrder;
	protected Integer createBy;
	protected Integer updateBy;
	protected java.util.Date createTime;
	protected java.util.Date updateTime;
	protected Integer version;

	protected java.util.Set newsletters = new java.util.HashSet();
	protected java.util.Set subscribers = new java.util.HashSet();

	/**
	 * Default Empty Constructor for class NewsletterGroup
	 */
	public NewsletterGroupTbl () {
		super();
	}
	
	/**
	 * Default Key Fields Constructor for class NewsletterGroup
	 */
	public NewsletterGroupTbl (
		 Integer in_newsletterGroupId
        ) {
		this.setNewsletterGroupId(in_newsletterGroupId);
    }


	public java.util.Set getNewsletters () {
		return newsletters;
	}	
	
	public void setNewsletters (java.util.Set in_newsletters) {
		this.newsletters = in_newsletters;
	}

	public java.util.Set getSubscribers () {
		return subscribers;
	}	
	
	public void setSubscribers (java.util.Set in_subscribers) {
		this.subscribers = in_subscribers;
	}
    

	/**
	 * 	 * @return Integer
     * @hibernate.id column="newsletterGroupId" type="java.lang.Integer" generator-class="native"
	 */
	public Integer getNewsletterGroupId() {
		return this.newsletterGroupId;
	}
	
	/**
	 * Set the newsletterGroupId
	 */	
	public void setNewsletterGroupId(Integer aValue) {
		this.newsletterGroupId = aValue;
	}	

	/**
	 * 	 * @return String
	 * @hibernate.property column="name" type="java.lang.String" length="128" not-null="true" unique="false"
	 */
	public String getName() {
		return this.name;
	}
	
	/**
	 * Set the name
	 * @spring.validator type="required"
	 */	
	public void setName(String aValue) {
		this.name = aValue;
	}	

	/**
	 * 	 * @return String
	 * @hibernate.property column="description" type="java.lang.String" length="1024" not-null="false" unique="false"
	 */
	public String getDescription() {
		return this.description;
	}
	
	/**
	 * Set the description
	 */	
	public void setDescription(String aValue) {
		this.description = aValue;
	}	

	/**
	 * 	 * @return String
	 * @hibernate.property column="templatePath" type="java.lang.String" length="128" not-null="false" unique="false"
	 */
	public String getTemplatePath() {
		return this.templatePath;
	}
	
	/**
	 * Set the templatePath
	 */	
	public void setTemplatePath(String aValue) {
		this.templatePath = aValue;
	}	

	/**
	 * 0=inactive
            1=active
            	 * @return Short
	 * @hibernate.property column="status" type="java.lang.Short" length="5" not-null="true" unique="false"
	 */
	public Short getStatus() {
		return this.status;
	}
	
	/**
	 * Set the status
	 */	
	public void setStatus(Short aValue) {
		this.status = aValue;
	}	
	
	/**
	 * 0=NO
            1=YES
            	 * @return Short
	 * @hibernate.property column="isVisibleToFront" type="java.lang.Short" length="5" not-null="true" unique="false"
	 */
	public Short getIsVisibleToFront() {
		return this.isVisibleToFront;
	}
	
	/**
	 * Set the status
	 */	
	public void setIsVisibleToFront(Short aValue) {
		this.isVisibleToFront = aValue;
	}

	/**
	 * 	 * @return Integer
	 * @hibernate.property column="sortOrder" type="java.lang.Integer" length="10" not-null="false" unique="false"
	 */
	public Integer getSortOrder() {
		return this.sortOrder;
	}
	
	/**
	 * Set the sortOrder
	 */	
	public void setSortOrder(Integer aValue) {
		this.sortOrder = aValue;
	}	

	/**
	 * 	 * @return Integer
	 * @hibernate.property column="createBy" type="java.lang.Integer" length="10" not-null="false" unique="false"
	 */
	public Integer getCreateBy() {
		return this.createBy;
	}
	
	/**
	 * Set the createBy
	 */	
	public void setCreateBy(Integer aValue) {
		this.createBy = aValue;
	}	

	/**
	 * 	 * @return Integer
	 * @hibernate.property column="updateBy" type="java.lang.Integer" length="10" not-null="false" unique="false"
	 */
	public Integer getUpdateBy() {
		return this.updateBy;
	}
	
	/**
	 * Set the updateBy
	 */	
	public void setUpdateBy(Integer aValue) {
		this.updateBy = aValue;
	}	

	/**
	 * 	 * @return java.util.Date
	 * @hibernate.property column="createTime" type="java.util.Date" length="0" not-null="false" unique="false"
	 */
	public java.util.Date getCreateTime() {
		return this.createTime;
	}
	
	/**
	 * Set the createTime
	 */	
	public void setCreateTime(java.util.Date aValue) {
		this.createTime = aValue;
	}	

	/**
	 * 	 * @return java.util.Date
	 * @hibernate.property column="updateTime" type="java.util.Date" length="0" not-null="false" unique="false"
	 */
	public java.util.Date getUpdateTime() {
		return this.updateTime;
	}
	
	/**
	 * Set the updateTime
	 */	
	public void setUpdateTime(java.util.Date aValue) {
		this.updateTime = aValue;
	}	

	/**
	 * 	 * @return Integer
	 * @hibernate.property column="version" type="java.lang.Integer" length="10" not-null="true" unique="false"
	 */
	public Integer getVersion() {
		return this.version;
	}
	
	/**
	 * Set the version
	 * @spring.validator type="required"
	 */	
	public void setVersion(Integer aValue) {
		this.version = aValue;
	}	

	/**
	 * @see java.lang.Object#equals(Object)
	 */
	public boolean equals(Object object) {
		if (!(object instanceof NewsletterGroupTbl)) {
			return false;
		}
		NewsletterGroupTbl rhs = (NewsletterGroupTbl) object;
		return new EqualsBuilder()
				.append(this.newsletterGroupId, rhs.newsletterGroupId)
				.append(this.name, rhs.name)
				.append(this.description, rhs.description)
				.append(this.templatePath, rhs.templatePath)
				.append(this.status, rhs.status)
				.append(this.sortOrder, rhs.sortOrder)
				.append(this.createBy, rhs.createBy)
				.append(this.updateBy, rhs.updateBy)
				.append(this.createTime, rhs.createTime)
				.append(this.updateTime, rhs.updateTime)
				.append(this.version, rhs.version)
				.isEquals();
	}

	/**
	 * @see java.lang.Object#hashCode()
	 */
	public int hashCode() {
		return new HashCodeBuilder(-82280557, -700257973)
				.append(this.newsletterGroupId) 
				.append(this.name) 
				.append(this.description) 
				.append(this.templatePath) 
				.append(this.status) 
				.append(this.sortOrder) 
				.append(this.createBy) 
				.append(this.updateBy) 
				.append(this.createTime) 
				.append(this.updateTime) 
				.append(this.version) 
				.toHashCode();
	}

	/**
	 * @see java.lang.Object#toString()
	 */
	public String toString() {
		return new ToStringBuilder(this)
				.append("newsletterGroupId", this.newsletterGroupId) 
				.append("name", this.name) 
				.append("description", this.description) 
				.append("templatePath", this.templatePath) 
				.append("status", this.status) 
				.append("sortOrder", this.sortOrder) 
				.append("createBy", this.createBy) 
				.append("updateBy", this.updateBy) 
				.append("createTime", this.createTime) 
				.append("updateTime", this.updateTime) 
				.append("version", this.version) 
				.toString();
	}

	/**
	 * Return the name of the first key column
	 */
	public String getFirstKeyColumnName() {
		return "newsletterGroupId";
	}
	
	/**
	 * Return the Id (pk) of the entity, must be Integer
	 */
	public Integer getId() {
		return newsletterGroupId;
	}

}